\contentsline {chapter}{\numberline {1}Introduction}{1}{chapter.1}
\contentsline {section}{\numberline {1.1}OpenCv}{1}{section.1.1}
\contentsline {section}{\numberline {1.2}OpenCvAda}{2}{section.1.2}
\contentsline {subsection}{\numberline {1.2.1}Design}{2}{subsection.1.2.1}
\contentsline {subsection}{\numberline {1.2.2}Benchmark}{2}{subsection.1.2.2}
\contentsline {subsection}{\numberline {1.2.3}User guide}{2}{subsection.1.2.3}
\contentsline {section}{\numberline {1.3}Interfacing Ada with C and C++}{2}{section.1.3}
\contentsline {section}{\numberline {1.4}GIMME Communication Protocol}{3}{section.1.4}
\contentsline {chapter}{\numberline {2}Design of OpenCvAda}{4}{chapter.2}
\contentsline {section}{\numberline {2.1}Naming conventions}{4}{section.2.1}
\contentsline {subsection}{\numberline {2.1.1}Types}{4}{subsection.2.1.1}
\contentsline {subsection}{\numberline {2.1.2}Functions}{4}{subsection.2.1.2}
\contentsline {subsection}{\numberline {2.1.3}Macros and Constants}{5}{subsection.2.1.3}
\contentsline {subsection}{\numberline {2.1.4}Pointers}{5}{subsection.2.1.4}
\contentsline {subsection}{\numberline {2.1.5}Packages}{6}{subsection.2.1.5}
\contentsline {subsection}{\numberline {2.1.6}Generic packages}{6}{subsection.2.1.6}
\contentsline {subsection}{\numberline {2.1.7}Summary}{6}{subsection.2.1.7}
\contentsline {section}{\numberline {2.2}Pointers}{6}{section.2.2}
\contentsline {subsection}{\numberline {2.2.1}Arrays}{7}{subsection.2.2.1}
\contentsline {subsection}{\numberline {2.2.2}Cv_Void}{7}{subsection.2.2.2}
\contentsline {subsection}{\numberline {2.2.3}Cv_Arr}{8}{subsection.2.2.3}
\contentsline {subsubsection}{Overloading}{8}{section*.3}
\contentsline {subsection}{\numberline {2.2.4}Strings}{8}{subsection.2.2.4}
\contentsline {section}{\numberline {2.3}Records}{8}{section.2.3}
\contentsline {subsection}{\numberline {2.3.1}Cv_Arr records}{8}{subsection.2.3.1}
\contentsline {subsection}{\numberline {2.3.2}Sequences and dynamic types}{9}{subsection.2.3.2}
\contentsline {subsection}{\numberline {2.3.3}Null records}{9}{subsection.2.3.3}
\contentsline {section}{\numberline {2.4}Type conversions}{9}{section.2.4}
\contentsline {chapter}{\numberline {3}OpenCvAda Benchmark}{10}{chapter.3}
\contentsline {section}{\numberline {3.1}What we want to test:}{10}{section.3.1}
\contentsline {subsection}{\numberline {3.1.1}Why test?}{10}{subsection.3.1.1}
\contentsline {subsection}{\numberline {3.1.2}Comparing OpenCvAda with OpenCv}{10}{subsection.3.1.2}
\contentsline {subsection}{\numberline {3.1.3}Scaling of OpenCvAda}{10}{subsection.3.1.3}
\contentsline {subsection}{\numberline {3.1.4}Does the speed of OpenCvAda change in another OS}{11}{subsection.3.1.4}
\contentsline {subsection}{\numberline {3.1.5}Samples}{11}{subsection.3.1.5}
\contentsline {section}{\numberline {3.2}What we tested with:}{11}{section.3.2}
\contentsline {subsection}{\numberline {3.2.1}The Benchmarker application}{11}{subsection.3.2.1}
\contentsline {subsection}{\numberline {3.2.2}The Memory usage application}{11}{subsection.3.2.2}
\contentsline {subsection}{\numberline {3.2.3}Platforms}{11}{subsection.3.2.3}
\contentsline {subsection}{\numberline {3.2.4}Hardware}{12}{subsection.3.2.4}
\contentsline {subsection}{\numberline {3.2.5}Image and Video files used}{12}{subsection.3.2.5}
\contentsline {section}{\numberline {3.3}The actual tests:}{12}{section.3.3}
\contentsline {subsection}{\numberline {3.3.1}Window creation}{12}{subsection.3.3.1}
\contentsline {subsection}{\numberline {3.3.2}Large image I/O}{13}{subsection.3.3.2}
\contentsline {subsection}{\numberline {3.3.3}Algorithms}{13}{subsection.3.3.3}
\contentsline {subsection}{\numberline {3.3.4}Memory usage}{13}{subsection.3.3.4}
\contentsline {subsection}{\numberline {3.3.5}Linux}{18}{subsection.3.3.5}
\contentsline {subsection}{\numberline {3.3.6}Executable reference}{21}{subsection.3.3.6}
\contentsline {subsection}{\numberline {3.3.7}Correctness}{21}{subsection.3.3.7}
\contentsline {section}{\numberline {3.4}Benchmark Results}{23}{section.3.4}
\contentsline {chapter}{\numberline {4}OpenCvAda User Guide}{28}{chapter.4}
\contentsline {section}{\numberline {4.1}Getting Started}{28}{section.4.1}
\contentsline {subsection}{\numberline {4.1.1}Installation}{28}{subsection.4.1.1}
\contentsline {subsection}{\numberline {4.1.2}Creating a OpenCvAda project in GNAT}{28}{subsection.4.1.2}
\contentsline {subsection}{\numberline {4.1.3}Hello World}{28}{subsection.4.1.3}
\contentsline {section}{\numberline {4.2}Basics }{30}{section.4.2}
\contentsline {subsection}{\numberline {4.2.1}Naming Guide}{30}{subsection.4.2.1}
\contentsline {subsubsection}{Functions}{30}{section*.4}
\contentsline {subsubsection}{Types and Constants}{30}{section*.5}
\contentsline {subsubsection}{Pointers}{31}{section*.6}
\contentsline {subsubsection}{Arrays}{31}{section*.7}
\contentsline {subsection}{\numberline {4.2.2}Standard Types}{31}{subsection.4.2.2}
\contentsline {subsubsection}{Integer and Float arrays}{31}{section*.8}
\contentsline {subsubsection}{Images and Matrices}{31}{section*.9}
\contentsline {subsubsection}{Null Records (``Black Box'' types)}{32}{section*.13}
\contentsline {subsubsection}{Strings}{33}{section*.14}
\contentsline {subsection}{\numberline {4.2.3}Highgui}{33}{subsection.4.2.3}
\contentsline {subsubsection}{Creating a Window}{33}{section*.15}
\contentsline {subsubsection}{Displaying Images}{33}{section*.16}
\contentsline {subsubsection}{Input}{34}{section*.17}
\contentsline {subsubsection}{Output}{35}{section*.18}
\contentsline {subsection}{\numberline {4.2.4}Camera, Video and Images}{36}{subsection.4.2.4}
\contentsline {subsubsection}{How to get an image from a camera}{36}{section*.19}
\contentsline {subsubsection}{How to get an image from a video file}{37}{section*.21}
\contentsline {subsubsection}{How to get an image from an image file}{37}{section*.22}
\contentsline {subsubsection}{Saving images}{38}{section*.23}
\contentsline {subsubsection}{Saving video files}{38}{section*.24}
\contentsline {section}{\numberline {4.3}Advanced}{39}{section.4.3}
\contentsline {subsection}{\numberline {4.3.1}Unchecked Conversions}{39}{subsection.4.3.1}
\contentsline {section}{\numberline {4.4}The Demo Application}{40}{section.4.4}
\contentsline {chapter}{\numberline {5}Interfacing Ada with C}{44}{chapter.5}
\contentsline {section}{\numberline {5.1}Basic types}{44}{section.5.1}
\contentsline {section}{\numberline {5.2}Composite types}{44}{section.5.2}
\contentsline {section}{\numberline {5.3}Interfacing C functions}{45}{section.5.3}
\contentsline {subsection}{\numberline {5.3.1}Macros from C}{46}{subsection.5.3.1}
\contentsline {section}{\numberline {5.4}Pointers}{47}{section.5.4}
\contentsline {subsection}{\numberline {5.4.1}What could a pointer from C be?}{47}{subsection.5.4.1}
\contentsline {subsection}{\numberline {5.4.2}Mapping int * to Ada}{47}{subsection.5.4.2}
\contentsline {subsubsection}{Access to a variable}{48}{section*.25}
\contentsline {subsubsection}{Arrays}{48}{section*.26}
\contentsline {subsubsection}{Interfaces.C.Pointers}{48}{section*.27}
\contentsline {subsection}{\numberline {5.4.3}Mapping int ** to Ada}{49}{subsection.5.4.3}
\contentsline {subsubsection}{Access to access}{49}{section*.28}
\contentsline {subsubsection}{Access to array}{49}{section*.29}
\contentsline {subsubsection}{Access to Interfaces.C.Pointers}{49}{section*.30}
\contentsline {subsubsection}{Two dimensional arrays}{50}{section*.31}
\contentsline {section}{\numberline {5.5}In out parameter}{50}{section.5.5}
\contentsline {section}{\numberline {5.6}Void *}{50}{section.5.6}
\contentsline {subsection}{\numberline {5.6.1}Pointers in records}{51}{subsection.5.6.1}
\contentsline {subsection}{\numberline {5.6.2}Constrained Arrays}{52}{subsection.5.6.2}
\contentsline {subsection}{\numberline {5.6.3}Strings}{52}{subsection.5.6.3}
\contentsline {subsection}{\numberline {5.6.4}Function pointers}{53}{subsection.5.6.4}
\contentsline {section}{\numberline {5.7}Type conformance between Ada and C}{54}{section.5.7}
\contentsline {subsection}{\numberline {5.7.1}Basic types}{54}{subsection.5.7.1}
\contentsline {subsection}{\numberline {5.7.2}Structs , arrays and pointers}{54}{subsection.5.7.2}
\contentsline {section}{\numberline {5.8}Pragmas, Conventions and Keywords}{54}{section.5.8}
\contentsline {subsection}{\numberline {5.8.1}Convention C_Pass_By_Copy}{54}{subsection.5.8.1}
\contentsline {subsection}{\numberline {5.8.2}Convention C}{55}{subsection.5.8.2}
\contentsline {subsection}{\numberline {5.8.3}Pragma Unchecked_Union}{55}{subsection.5.8.3}
\contentsline {subsection}{\numberline {5.8.4}Pragma Import}{55}{subsection.5.8.4}
\contentsline {subsection}{\numberline {5.8.5}Aliased}{55}{subsection.5.8.5}
\contentsline {chapter}{\numberline {6}Interfacing Ada with C++}{56}{chapter.6}
\contentsline {section}{\numberline {6.1}Importing functions from C++}{56}{section.6.1}
\contentsline {section}{\numberline {6.2}Importing Classes from C++}{57}{section.6.2}
\contentsline {subsection}{\numberline {6.2.1}Vector and String}{58}{subsection.6.2.1}
\contentsline {chapter}{\numberline {7}GIMME Communication Protocol}{59}{chapter.7}
\contentsline {section}{\numberline {7.1}Requirements}{59}{section.7.1}
\contentsline {subsection}{\numberline {7.1.1}GCP Functionality}{61}{subsection.7.1.1}
\contentsline {subsection}{\numberline {7.1.2}PC requirements}{62}{subsection.7.1.2}
\contentsline {section}{\numberline {7.2}Design}{62}{section.7.2}
\contentsline {subsection}{\numberline {7.2.1}Header structure}{62}{subsection.7.2.1}
\contentsline {subsection}{\numberline {7.2.2}Raw Ethernet header}{63}{subsection.7.2.2}
\contentsline {subsection}{\numberline {7.2.3}Constant and specification headers}{63}{subsection.7.2.3}
\contentsline {subsubsection}{Constant header}{63}{section*.32}
\contentsline {subsubsection}{Specification headers}{67}{section*.36}
\contentsline {subsection}{\numberline {7.2.4}PC GCP driver design}{71}{subsection.7.2.4}
\contentsline {subsubsection}{System design}{71}{section*.44}
\contentsline {subsubsection}{Network layer}{71}{section*.45}
\contentsline {subsubsection}{Frame buffer layer}{72}{section*.46}
\contentsline {subsubsection}{Thread layer}{72}{section*.47}
\contentsline {subsubsection}{Transaction buffer layer}{72}{section*.48}
\contentsline {subsubsection}{API layer}{73}{section*.49}
\contentsline {chapter}{\numberline {8}Summary and Conclusions}{74}{chapter.8}
\contentsline {chapter}{\numberline {9}Future Work}{76}{chapter.9}
\contentsline {chapter}{\numberline {A}Hough_Lines.adb}{78}{appendix.A}
\contentsline {chapter}{\numberline {B}Demo Application}{80}{appendix.B}
\contentsline {section}{\numberline {B.1}Demo.gpr}{80}{section.B.1}
\contentsline {section}{\numberline {B.2}Demo.adb}{80}{section.B.2}
